import Vue from 'vue'
Vue.filter('formatTimeStamp', function (val) {
  const date = new Date(val)
  const hour = date.getHours()
  const minutes = date.getMinutes()
  const seconds = date.getSeconds()
  return `${hour} : ${minutes} : ${seconds}`
})

Vue.filter('displayLabelValue', function (value, labelValueMap) {
  const display = labelValueMap.reduce((acc, cur) => {
    acc[cur.value] = cur.label
    return acc
  }, {})
  return display[value]
})

Vue.filter('combination', function (value, param) {
  const map = new Map(Object.entries(value))
  return map.get(param)
})

export default {}
